#!/usr/bin/env python
# -*- coding:utf-8 -*-
import re

print('===============search===============')
match = re.search(r'[A-Z]+', '河北大学简称HBU')
if match:
    print(match.group(0))

print('===============match===============')
match = re.match(r'[A-Za-z1-9]+', 'Start HBU1河北大学简称HBU')
if match:
    print(match.group(0))

print('===============findall===============')
ls = re.findall(r'[A-Za-z1-9]+', 'Start HBU1河北大学简称HBU')
print(ls)

print('===============split===============')
ls = re.split(r'[A-Za-z1-9]+', 'Start HBU1河北大学简称HBU')
print(ls)

print('===============finditer===============')
for m in re.finditer(r'[A-Z]+', 'HBU153256 BIT100081'):
    if m:
        print(m.group(0))

print('===============sub===============')
sub = re.sub(r'[1]\d{10}', 'tel_num', '我的手机号：13145205218')
print(sub)
